﻿<primitives:DialogBase x:Class="Neurotoxin.Godspeed.Shell.Views.Dialogs.TreeSelectionDialog"
                       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                       xmlns:primitives="clr-namespace:Neurotoxin.Godspeed.Shell.Primitives"
                       xmlns:lex="http://wpflocalizeextension.codeplex.com"
                       lex:LocalizeDictionary.DesignCulture="en-US"
                       lex:ResxLocalizationProvider.DefaultAssembly="Neurotoxin.Godspeed.Shell"
                       lex:ResxLocalizationProvider.DefaultDictionary="Resources"
                       Width="400" Height="400" Title="{Binding TreeSelectionTitle}">
    <primitives:DialogBase.Resources>
        <ResourceDictionary>
        </ResourceDictionary>
    </primitives:DialogBase.Resources>
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <TextBlock Grid.Row="0" Text="{Binding TreeSelectionDescription}" Margin="0,0,0,5"/>
        
        <TreeView Grid.Row="1" ItemsSource="{Binding SelectionTree}" BorderBrush="{StaticResource NormalBorderBrush}">
            <TreeView.ItemContainerStyle>
                <Style TargetType="{x:Type TreeViewItem}">
                    <Setter Property="IsExpanded" Value="True"/>
                </Style>
            </TreeView.ItemContainerStyle>
            <TreeView.ItemTemplate>
                <HierarchicalDataTemplate ItemsSource="{Binding Path=Children}">
                    <DockPanel Margin="0,0,0,1">
                        <CheckBox IsChecked="{Binding IsChecked}" Padding="0,-2,0,0" IsThreeState="True"/>
                        <ContentPresenter Content="{Binding}" ContentTemplate="{StaticResource FileSystemItemTitleTemplate}"/>
                    </DockPanel>
                </HierarchicalDataTemplate>
            </TreeView.ItemTemplate>
        </TreeView>

        <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10,0,5">
            <Button Content="{lex:LocText Ok}" MinWidth="75" x:Name="Ok" Click="OkButtonClick" Margin="0,0,5,0"/>
            <Button Content="{lex:LocText Cancel}" MinWidth="75" x:Name="Cancel" Click="CancelButtonClick"/>
        </StackPanel>
    </Grid>
</primitives:DialogBase>